Establishing a TCP connection involves a three-way handshake, where a connection initiator sends a TCP <SYN> packet, the responder sends a corresponding <SYN, ACK> packet, and the initiator acknowledges with a subsequent <ACK> packet. An example of this sequence of events involving a TCP connection received at a conventional proxy is illustrated in FIG. 1. In this example, a client 10 is communicatively connected to a proxy 14 via a network 12. Proxy 14 is communicatively coupled to a server 18 across a wide area network (WAN) 16.
As illustrated, when the client 10 initiates a connection request, a TCP <SYN> packet 20 is transmitted to proxy 14. Proxy 14 responds with a conventional <SYN, ACK> packet 22, which client 10 acknowledges by sending an <ACK> packet 24. Thereafter, client 10 may send an actual request (e.g., an HTTP GET request or other request, for example where client 10 is an application other than a web browser) 26.
Only after completing the TCP handshake with client 10 and receiving an actual request does proxy 14 first attempt to contact server 18. This is because until this point, proxy 14 did not have sufficient knowledge of the intended communication to initiate contact with the server. Hence, proxy 14 initiates its own TCP handshake with server 18 by sending <SYN> packet 28. Server 18 responds by sending <SYN, ACK> packet 30, which the proxy acknowledges with <ACK> packet 32. Thereafter, proxy 14 sends request 34 on to server 18. This may be a modified or unmodified version of the original request 26 sent by client 10.
Assuming everything has gone well to this point in the above-described communication, the client and server will begin exchanging data (e.g., responses 36, 38) with one another via proxy 14. At least two separate TCP sessions are implicated in this communication; one between client 10 and proxy 14 and another between proxy 14 and server 18. However, notice that in the above-described communication the proxy 14 actually completes a TCP handshake with the client 10 before the proxy ever determines whether or not the server 18 is available and/or willing to accept the intended communication. If the proxy is operating in transparent mode, the client will assume that the server 18, and not the proxy 14, has completed the TCP handshake and will begin issuing requests. If the proxy 14 were now to report that it was unable to reach or otherwise complete a TCP handshake with server 18, this could have undesirable consequences for the overall communication and/or any applications executing on client 10.